import logging,yagmail
def log_set():
    logging.basicConfig(filename="log2.txt",filemode="w+",level=logging.DEBUG,format='%(filename)s -> %(asctime)s -> %(levelno)s ->%(message)s ')

def send_mail(filepath):
    mail =yagmail.SMTP(user="2930885223@qq.com",password="ilarvpztxodrdgha",host="smtp.qq.com")
    mail.send(to="2930885223@qq.com",subject="测试报告",contents="吉日报告",attachments=filepath)